using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WhsFacebook.Whs.Contracts;

namespace WhsFacebook.Whs.Service
{
    partial class SingletonService
    {
        public SettingsAll GetAllSettings()
        {
            try
            {
                return new SettingsAll()
                {
                    ErrorReportsSubmissionEnabled = IsErrorReportsSubmissionEnabled(),
                };
            }
            catch (Exception e)
            {
                _log.Error("SetErrorReportsSubmissionEnabled() failed", e);

                throw;
            }
        }

        public void SetAllSettings(SettingsAll s)
        {
            try
            {
                SetErrorReportsSubmissionEnabled(s.ErrorReportsSubmissionEnabled, false);

                Properties.Settings.Default.Save();
            }
            catch (Exception e)
            {
                _log.Error("SetAllSettings() failed", e);

                throw;
            }
        }
    }
}
